package com.hwh.trafficdemo.dao;



import com.hwh.trafficdemo.entity.Routes;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

@Repository
@Mapper
public interface IRouteDao {


    @Insert("INSERT into route(route_id,route_name,opposite_id) values (#{routeId},#{routeName},#{oppositeId})")
    int savaRoute(Routes routes);

    @Select("SELECT route_id FROM route WHERE route_name like CONCAT(#{routeName},'%')")
    Long findRouteIdByName(String routeName);
}
